package com.example.administrator.maizuofilm.cinemadetail;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ScrollView;

public class MovieDetailScrollView
        extends ScrollView
{
    private a a;
    private b b;
    private View c;

    public MovieDetailScrollView(Context paramContext)
    {
        super(paramContext);
        if (isInEditMode()) {}
    }

    public MovieDetailScrollView(Context paramContext, AttributeSet paramAttributeSet)
    {
        super(paramContext, paramAttributeSet);
        if (isInEditMode()) {}
    }

    public MovieDetailScrollView(Context paramContext, AttributeSet paramAttributeSet, int paramInt)
    {
        super(paramContext, paramAttributeSet, paramInt);
        if (isInEditMode()) {}
    }

    private void a()
    {
        if ((this.c != null) && (this.c.getMeasuredHeight() < getScrollY() + getHeight() + 5)) {
            if (this.a != null) {
                this.a.a();
            }
        }
        while ((getScrollY() != 0) || (this.a == null)) {
            return;
        }
        this.a.b();
    }

    protected void onScrollChanged(int paramInt1, int paramInt2, int paramInt3, int paramInt4)
    {
        super.onScrollChanged(paramInt1, paramInt2, paramInt3, paramInt4);
        if (this.b != null) {
            this.b.onScrollChanged(paramInt1, paramInt2, paramInt3, paramInt4);
        }
        a();
    }

    public void setOnBorderListener(a parama)
    {
        this.a = parama;
        if (parama == null) {}
        while (this.c != null) {
            return;
        }
        this.c = getChildAt(0);
    }

    public void setOnScrollChangedListener(b paramb)
    {
        this.b = paramb;
    }

    public static abstract interface a
    {
        public abstract void a();

        public abstract void b();
    }

    public static abstract interface b
    {
        public abstract void onScrollChanged(int paramInt1, int paramInt2, int paramInt3, int paramInt4);
    }
}
